import request from '@/utils/request'

export async function getProjectMaintainListApi(params) {
  var resp = await request({
    url: '/project/projectmaintain/',
    method: 'get',
    params
  })
  return resp;
}

export async function createProjectMaintainApi(data) {
  var resp = await request({
    url: '/project/projectmaintain/',
    method: 'post',
    data
  })
  return resp
}

export async function updateProjectMaintainApi(id, data) {
  var resp = await request({
    url: '/project/projectmaintain/' + id + '/',
    method: 'put',
    data
  })
  return resp
}

export async function deleteProjectMaintainApi(id) {
  var resp = await request({
    url: '/project/projectmaintain/' + id + '/',
    method: 'delete'
  })
  return resp
}
export async function BatchdeleteMaintainProjectApi(data) {
  var resp = await request({
    url: `/project/projectmaintain/${data}/batchDelete/`,
    method: 'delete',
    data
  })
  return resp
}
// 根据项目计划书ID与报价单号，自动计算初始数据
export async function getProjectInitDataApi(params) {
  var resp = await request({
    url: '/project/get_inidata/',
    method: 'get',
    params
  })
  return resp;
}
export async function releaseMaintainProjectBaseApi(id) {
  var resp = await request({
    url: '/project/projectmaintain/' + id + '/release/',
    method: 'put'
  })
  return resp
}

export async function closeMaintainProjectBaseApi(id) {
  var resp = await request({
    url: '/project/projectmaintain/' + id + '/close/',
    method: 'put'
  })
  return resp
}

// 维护项目核算履历信息
export async function getProjectMaintainAccountApi(params) {
  var resp = await request({
    url: '/project/projectmaintainaccount/',
    method: 'get',
    params
  })
  return resp;
}
// 维护项目阶段别预实管理信息
export async function getProjectMaintainStageApi(params) {
  var resp = await request({
    url: '/project/projectmaintainstage/',
    method: 'get',
    params
  })
  return resp;
}
// 拆分维护项目订单
export async function splitProjectMaintainApi(id, data) {
  var resp = await request({
    url: '/project/projectmaintain/' + id + '/SplitUpdate/',
    method: 'put',
    data
  })
  return resp
}
